package breadbox.pastry;

import java.io.Serializable;

public interface ID extends Serializable, Comparable< ID > {
	/**
	 * Returns the prefix common between this ID and another.
	 * @return
	 */
	public abstract String commonPrefix( ID other );
	
	/**
	 * Returns the base of the ID. So would return 16 for hex and 8 for octal.
	 * @return
	 */
	public abstract int base( );
	
	public abstract boolean equals(ID other);
	
	public abstract long distance(ID other);
	
	/**
	 * Convert this ID to a String, using a different base than its own.
	 * @param base
	 * @return
	 */
	public abstract String toString( int base );
}
